.TH std::atomic_ref::exchange 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::atomic_ref::exchange \- std::atomic_ref::exchange

.SH Synopsis
   T exchange( T desired, std::memory_order order =                       \fI(since C++20)\fP
   std::memory_order_seq_cst ) const noexcept;

   Atomically replaces the value of the referenced object with desired. The operation
   is a read-modify-write operation. Memory is affected according to the value of
   order.

.SH Parameters

   desired - value to assign
   order   - memory order constraints to enforce

.SH Return value

   The value of the referenced object before the call.
